<?php
  require_once("../includes.php");
  $membership = New Membership();
  $membership->confirm_admin();

  $users = User::get_all();
  $count = 0;
  include('../header.php');
?>

<div id='login'>
<table>
  <tr class='red'>
    <th>Voornaam</th>
    <th>Achternaam</th>
    <th class='long'>E-mail</th>
    <th></th>
    <th></th>
  </tr>

<?php foreach($users as $user) : ?>

  <tr class="<?php echo ($count++ % 2 == 1) ? 'odd' : 'even' ?>">
    <td><?php echo $user->firstname; ?></td>
    <td><?php echo $user->lastname; ?></td>
    <td class='long'><?php echo $user->email; ?></td>
    <td class='short'><?php echo Website::create_link("user/edit.php?id=".$user->ID."", "Aanpassen", "edit"); ?></td>
    <td class='short'><?php echo Website::create_link("user/delete.php?id=".$user->ID."", "Verwijderen", "delete"); ?></td>
  </tr>

<?php endforeach; ?>
</table>
</div>
<?php include('../footer.php'); ?>